﻿using System;
using System.Collections.Generic;
using UnityEngine;

public class Sharderunit
{
    public static void ResetShader(GameObject gameObject)
    {
        if (gameObject != null)
        {
            Renderer renderer = gameObject.GetComponent<Renderer>();
            ResetShader(renderer);
            foreach (Transform sub in gameObject.transform)
            {
                ResetShader(sub.gameObject);
            }
        }
    }
    public static void ResetShader(Renderer renderer)
    {
        if (renderer != null) renderer.material.shader = Shader.Find(renderer.material.shader.name);
    }
}
